Rename some local vars to start with a lowercase letter
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 15 Mar 2014 11:32:44 +0000 (12:32 +0100)
committerIAlex <codereview@emsenhuber.ch>
Sat, 15 Mar 2014 21:03:05 +0000 (21:03 +0000)
Change-Id: I6e5975ed7351c1439eda19afaba5120c6afa50f1

includes/GitInfo.php
includes/Sanitizer.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/parser/Parser.php
includes/search/SearchPostgres.php
includes/specials/SpecialRevisiondelete.php

index 877c2d2..6b092d9 100644 (file)
@@ -82,18 +82,18 @@ class GitInfo {
         * @return string The HEAD
         */
        public function getHead() {
-               $HEADfile = "{$this->basedir}/HEAD";
+               $headFile = "{$this->basedir}/HEAD";
 
-               if ( !is_readable( $HEADfile ) ) {
+               if ( !is_readable( $headFile ) ) {
                        return false;
                }
 
-               $HEAD = file_get_contents( $HEADfile );
+               $head = file_get_contents( $headFile );
 
-               if ( preg_match( "/ref: (.*)/", $HEAD, $m ) ) {
+               if ( preg_match( "/ref: (.*)/", $head, $m ) ) {
                        return rtrim( $m[1] );
                } else {
-                       return rtrim( $HEAD );
+                       return rtrim( $head );
                }
        }
 
@@ -102,20 +102,20 @@ class GitInfo {
         * @return string A SHA1 or false
         */
        public function getHeadSHA1() {
-               $HEAD = $this->getHead();
+               $head = $this->getHead();
 
                // If detached HEAD may be a SHA1
-               if ( self::isSHA1( $HEAD ) ) {
-                       return $HEAD;
+               if ( self::isSHA1( $head ) ) {
+                       return $head;
                }
 
                // If not a SHA1 it may be a ref:
-               $REFfile = "{$this->basedir}/{$HEAD}";
-               if ( !is_readable( $REFfile ) ) {
+               $refFile = "{$this->basedir}/{$head}";
+               if ( !is_readable( $refFile ) ) {
                        return false;
                }
 
-               $sha1 = rtrim( file_get_contents( $REFfile ) );
+               $sha1 = rtrim( file_get_contents( $refFile ) );
 
                return $sha1;
        }
@@ -150,11 +150,11 @@ class GitInfo {
         * @return string The branch name, HEAD, or false
         */
        public function getCurrentBranch() {
-               $HEAD = $this->getHead();
-               if ( $HEAD && preg_match( "#^refs/heads/(.*)$#", $HEAD, $m ) ) {
+               $head = $this->getHead();
+               if ( $head && preg_match( "#^refs/heads/(.*)$#", $head, $m ) ) {
                        return $m[1];
                } else {
-                       return $HEAD;
+                       return $head;
                }
        }
 
index dd87b06..245714d 100644 (file)
@@ -1839,7 +1839,7 @@ class Sanitizer {
                $rfc5322_atext = "a-z0-9!#$%&'*+\\-\/=?^_`{|}~";
                $rfc1034_ldh_str = "a-z0-9\\-";
 
-               $HTML5_email_regexp = "/
+               $html5_email_regexp = "/
                ^                      # start of string
                [$rfc5322_atext\\.]+    # user part which is liberal :p
                @                      # 'apostrophe'
@@ -1848,6 +1848,6 @@ class Sanitizer {
                $                      # End of string
                /ix"; // case Insensitive, eXtended
 
-               return (bool)preg_match( $HTML5_email_regexp, $addr );
+               return (bool)preg_match( $html5_email_regexp, $addr );
        }
 }
index 998dd75..6e0490d 100644 (file)
@@ -1034,8 +1034,8 @@ class DatabaseOracle extends DatabaseBase {
                $table = strtoupper( $this->removeIdentifierQuotes( $table ) );
                $index = strtoupper( $index );
                $owner = strtoupper( $this->mDBname );
-               $SQL = "SELECT 1 FROM all_indexes WHERE owner='$owner' AND index_name='{$table}_{$index}'";
-               $res = $this->doQuery( $SQL );
+               $sql = "SELECT 1 FROM all_indexes WHERE owner='$owner' AND index_name='{$table}_{$index}'";
+               $res = $this->doQuery( $sql );
                if ( $res ) {
                        $count = $res->numRows();
                        $res->free();
@@ -1056,8 +1056,8 @@ class DatabaseOracle extends DatabaseBase {
                $table = $this->tableName( $table );
                $table = $this->addQuotes( strtoupper( $this->removeIdentifierQuotes( $table ) ) );
                $owner = $this->addQuotes( strtoupper( $this->mDBname ) );
-               $SQL = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_name=$table";
-               $res = $this->doQuery( $SQL );
+               $sql = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_name=$table";
+               $res = $this->doQuery( $sql );
                if ( $res && $res->numRows() > 0 ) {
                        $exists = true;
                } else {
index c8830d3..6aee528 100644 (file)
@@ -349,11 +349,11 @@ class DatabasePostgres extends DatabaseBase {
        }
 
        function hasConstraint( $name ) {
-               $SQL = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n " .
+               $sql = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n " .
                        "WHERE c.connamespace = n.oid AND conname = '" .
                        pg_escape_string( $this->mConn, $name ) . "' AND n.nspname = '" .
                        pg_escape_string( $this->mConn, $this->getCoreSchema() ) . "'";
-               $res = $this->doQuery( $SQL );
+               $res = $this->doQuery( $sql );
 
                return $this->numRows( $res );
        }
@@ -1360,10 +1360,10 @@ __INDEXATTR__;
                $table = $this->realTableName( $table, 'raw' );
                $etable = $this->addQuotes( $table );
                $eschema = $this->addQuotes( $schema );
-               $SQL = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "
+               $sql = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "
                        . "WHERE c.relnamespace = n.oid AND c.relname = $etable AND n.nspname = $eschema "
                        . "AND c.relkind IN ('" . implode( "','", $types ) . "')";
-               $res = $this->query( $SQL );
+               $res = $this->query( $sql );
                $count = $res ? $res->numRows() : 0;
 
                return (bool)$count;
@@ -1421,13 +1421,13 @@ SQL;
        }
 
        function constraintExists( $table, $constraint ) {
-               $SQL = sprintf( "SELECT 1 FROM information_schema.table_constraints " .
+               $sql = sprintf( "SELECT 1 FROM information_schema.table_constraints " .
                        "WHERE constraint_schema = %s AND table_name = %s AND constraint_name = %s",
                        $this->addQuotes( $this->getCoreSchema() ),
                        $this->addQuotes( $table ),
                        $this->addQuotes( $constraint )
                );
-               $res = $this->query( $SQL );
+               $res = $this->query( $sql );
                if ( !$res ) {
                        return null;
                }
index 915beba..f2c4fbf 100644 (file)
@@ -1293,19 +1293,19 @@ class Parser {
                        if ( substr( $m[0], 0, 3 ) === 'RFC' ) {
                                $keyword = 'RFC';
                                $urlmsg = 'rfcurl';
-                               $CssClass = 'mw-magiclink-rfc';
+                               $cssClass = 'mw-magiclink-rfc';
                                $id = $m[4];
                        } elseif ( substr( $m[0], 0, 4 ) === 'PMID' ) {
                                $keyword = 'PMID';
                                $urlmsg = 'pubmedurl';
-                               $CssClass = 'mw-magiclink-pmid';
+                               $cssClass = 'mw-magiclink-pmid';
                                $id = $m[4];
                        } else {
                                throw new MWException( __METHOD__ . ': unrecognised match type "' .
                                        substr( $m[0], 0, 20 ) . '"' );
                        }
                        $url = wfMessage( $urlmsg, $id )->inContentLanguage()->text();
-                       return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $CssClass );
+                       return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $cssClass );
                } elseif ( isset( $m[5] ) && $m[5] !== '' ) {
                        # ISBN
                        $isbn = $m[5];
index dff6a72..142e5fd 100644 (file)
@@ -140,8 +140,8 @@ class SearchPostgres extends SearchDatabase {
                $searchstring = $this->parseQuery( $term );
 
                ## We need a separate query here so gin does not complain about empty searches
-               $SQL = "SELECT to_tsquery($searchstring)";
-               $res = $this->db->query( $SQL );
+               $sql = "SELECT to_tsquery($searchstring)";
+               $res = $this->db->query( $sql );
                if ( !$res ) {
                        ## TODO: Better output (example to catch: one 'two)
                        die( "Sorry, that was not a valid search string. Please go back and try again" );
@@ -196,10 +196,10 @@ class SearchPostgres extends SearchDatabase {
 
        function update( $pageid, $title, $text ) {
                ## We don't want to index older revisions
-               $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN " .
+               $sql = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN " .
                                "(SELECT rev_text_id FROM revision WHERE rev_page = " . intval( $pageid ) .
                                " ORDER BY rev_text_id DESC OFFSET 1)";
-               $this->db->query( $SQL );
+               $this->db->query( $sql );
                return true;
        }
 
index da229f0..05c8872 100644 (file)
@@ -333,7 +333,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * which will allow the user to choose new visibility settings.
         */
        protected function showForm() {
-               $UserAllowed = true;
+               $userAllowed = true;
 
                if ( $this->typeName == 'logging' ) {
                        $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count( $this->ids ) ) );
@@ -353,7 +353,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                if ( !$this->submitClicked ) {
                                        throw new PermissionsError( 'suppressrevision' );
                                }
-                               $UserAllowed = false;
+                               $userAllowed = false;
                        }
                        $numRevisions++;
                        $this->getOutput()->addHTML( $item->getHTML() );
@@ -368,7 +368,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $this->addUsageText();
 
                // Normal sysops can always see what they did, but can't always change it
-               if ( !$UserAllowed ) {
+               if ( !$userAllowed ) {
                        return;
                }